package com.wolf.etl.enumeration;

/**
 * @author sdyang
 * @date 2019/12/25 15:20
 **/
public enum INSTANCE_STATUS {
    ENABLE(1), FINISH(2), ERROR(-1);
    private Integer value;

    INSTANCE_STATUS(Integer value) {
        this.value = value;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public static INSTANCE_STATUS get(Integer value) {
        if(value == null){
            return null;
        }
        switch (value) {
            case -1:
                return ERROR;
            case 1:
                return ENABLE;
            case 2:
                return FINISH;
        }
        return null;
    }
}
